package reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class ReflectDemo3 {
    public static void main(String[] args) throws InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException, ClassNotFoundException {
        Class cls = Class.forName("reflect.Person");
        Constructor c = cls.getConstructor(String.class);
        Object obj = c.newInstance("王五");
        System.out.println(obj);
    }
}
